<template>
  <section class="claimdetails">
    <el-dialog
      v-dialogDrag
      :visible.sync="curPopupsVisible"
      :title="titleName"
      width="70%"
      :append-to-body="true"
      :close-on-click-modal="false"
      @opened="openDialog"
      @close="closeEdit"
    >
      <dialogHeader slot="title" :title="titleName" :style-type="$store.state.app.dialogType" />
      <!-- 基本信息 -->
      <div class="filter-container filter-title">基本信息</div>
      <div class="filter-container filter-params">
        <el-row ref="vailComponentList1">
          <component
            :is="comp.component"
            v-for="comp in tableComponents1.filter((o) => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds"
            :code="formField[comp.codeField]"
            :disabled="true"
            :o-fields="comp.oFields"
            :options="comp.options"
            :custom-obj="comp.customObj"
            :is-require="comp.isRequire"
            :is-mul="comp.isMul"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :data-to-object="comp.dataToObj"
            :date-options-type="comp.dateOptionsType"
            @changeCode="getComponentCode"
            @focusCode="getFocusCode"
          />
        </el-row>
      </div>
      <!-- 车辆信息 -->
      <div class="filter-container filter-title">车辆信息</div>
      <div class="filter-container filter-params">
        <el-row ref="vailComponentList1">
          <component
            :is="comp.component"
            v-for="comp in tableComponents2.filter((o) => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds"
            :code="formField[comp.codeField]"
            :disabled="true"
            :o-fields="comp.oFields"
            :options="comp.options"
            :custom-obj="comp.customObj"
            :is-require="comp.isRequire"
            :is-mul="comp.isMul"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :data-to-object="comp.dataToObj"
            :date-options-type="comp.dateOptionsType"
            @clickEvent="receiveEvent(comp.clickEvent)"
            @changeCode="getComponentCode"
            @focusCode="getFocusCode"
          />
        </el-row>
      </div>
      <!-- 客户信息 -->
      <div class="filter-container filter-title">客户信息</div>
      <div class="filter-container filter-params">
        <el-row ref="vailComponentList1">
          <component
            :is="comp.component"
            v-for="comp in tableComponents3.filter((o) => o.isMust === true)"
            :ref="comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey"
            :key="comp.compKey"
            :validrule="comp.validrule"
            :code-field="comp.codeField"
            :text-field="comp.textField"
            :popups-key="comp.compKey"
            :parent-fileds="comp.parentFileds"
            :code="formField[comp.codeField]"
            :disabled="comp.disabled"
            :o-fields="comp.oFields"
            :options="comp.options"
            :custom-obj="comp.customObj"
            :is-require="comp.isRequire"
            :is-mul="comp.isMul"
            :span="comp.span || 8"
            :label-name="comp.labelName"
            :lookuptype="comp.lookuptype"
            :data-to-object="comp.dataToObj"
            :date-options-type="comp.dateOptionsType"
            @changeCode="getComponentCode"
            @focusCode="getFocusCode"
          />
        </el-row>
      </div>
      <!-- 其他信息 -->
      <div class="filter-container filter-title">其他信息</div>
      <el-tabs v-model="activeName" style="background: #ffff">
        <el-tab-pane label="故障信息" name="first">
          <div class="filter-container filter-params">
            <el-row ref="vailComponentList1">
              <component
                :is="comp.component"
                v-for="comp in tableComponents4.filter((o) => o.isMust === true)"
                :ref="
                  comp.isRequire ? comp.isRequire + comp.compKey : comp.compKey
                "
                :key="comp.compKey"
                :validrule="comp.validrule"
                :code-field="comp.codeField"
                :text-field="comp.textField"
                :popups-key="comp.compKey"
                :parent-fileds="comp.parentFileds"
                :code="formField[comp.codeField]"
                :disabled="true"
                :o-fields="comp.oFields"
                :options="comp.options"
                :custom-obj="comp.customObj"
                :is-require="comp.isRequire"
                :is-mul="comp.isMul"
                :span="comp.span || 8"
                :label-name="comp.labelName"
                :lookuptype="comp.lookuptype"
                :data-to-object="comp.dataToObj"
                :date-options-type="comp.dateOptionsType"
                @changeCode="getComponentCode"
                @focusCode="getFocusCode"
              />
            </el-row>
          </div>
        </el-tab-pane>
        <el-tab-pane label="附件信息" name="second">
          <OneTableTemplate
            ref="table_3_1"
            :dynamic-table-cols="tableHeader_4_2"
            :dynamic-is-show-select="false"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="索赔工时" name="three">
          <OneTableTemplate
            ref="table_3_2"
            :dynamic-table-cols="tableHeader_4_3"
            :dynamic-is-show-select="false"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="索赔备件" name="four">
          <OneTableTemplate
            ref="table_3_3"
            :dynamic-table-cols="tableHeader_4_4"
            :dynamic-is-show-select="false"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="索赔其他项目" name="five">
          <OneTableTemplate
            ref="table_3_4"
            :dynamic-table-cols="tableHeader_4_5"
            :dynamic-is-show-select="false"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="审核信息" name="six">
          <OneTableTemplate
            ref="table_3_5"
            :dynamic-table-cols="tableHeader_4_6"
            :dynamic-is-show-select="false"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="倒扣信息" name="seven">
          <OneTableTemplate
            ref="table_3_6"
            :dynamic-components="tableHeader_4_7"
            :dynamic-is-show-select="false"
            :is-show-pagination="false"
          />
        </el-tab-pane>
        <el-tab-pane label="申诉信息" name="eight">
          <OneTableTemplate
            ref="table_3_7"
            :dynamic-table-cols="tableHeader_4_6"
            :dynamic-is-show-select="false"
            :is-show-pagination="false"
          />
        </el-tab-pane>
      </el-tabs>
    </el-dialog>
  </section>
</template>

<script>
import OneTableTemplate from '@/components/templates/oneTable'
import dialogHeader from '@/components/dialogHeader'
import { oneTableWithViewTemplateMixins } from '@/components/mixins/oneTableWithViewTemplateMixins'
import { formMixins } from '@/components/mixins/formMixins'
import QueryComponent from '@/components/QueryComponent/QueryComponent'
import api from '@/api/se/apiClaimService'

export default {
  components: {
    dialogHeader,
    OneTableTemplate,
    QueryComponent
  },
  mixins: [oneTableWithViewTemplateMixins, formMixins],
  props: {
    popupsVisible: {
      type: Boolean,
      default: false
    },
    dynamicEditRowData: {
      type: Object,
      default: function() { return {} }
    }
  },
  data() {
    return {
      printPopupsKey: '1',
      printRowData: {},
      printPopupsVisible: false,
      titleName: '索赔工单详情',
      activeName: 'first',
      isView: false,
      tableComponents1: [
        {
          compKey: 'key0',
          labelName: '门店编码：',
          codeField: 'dlrCode',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key1',
          labelName: '门店名称：',
          codeField: 'dlrFullName',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key2',
          labelName: '索赔单号：',
          codeField: 'claimCode',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key3',
          labelName: '单据状态：',
          codeField: 'claimStatus',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key4',
          labelName: '索赔员：',
          codeField: 'claimEmpNO',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key5',
          labelName: '索赔员电话：',
          codeField: 'linkManTel',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key6',
          labelName: '索赔分类',
          codeField: 'claimType',
          textField: 'claimCategoryName',
          component: () => import('@/components/org/commonSelect'),
          customObj: {
            api: api.findClaimCategory,
            defOptionFields: ['claimCategoryCode', 'claimCategoryName'],
            selectType: '1'
          },
          type: 'dropdownList',
          isMust: true,
          isRequire: true,
          disabled: true
        },
        {
          compKey: 'key7',
          labelName: '活动编号',
          codeField: 'actionCode',
          component: () => import('@/components/org/LookupValue'),
          oFields: 'statusId,statusText',
          options: [
            { statusId: '1', statusText: '文章1' },
            { statusId: '0', statusText: '文章' }
          ],
          type: 'dropdownList',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key8',
          labelName: '索赔月份：',
          codeField: 'claimMonth',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key9',
          labelName: '提交日期：',
          codeField: 'submitDate',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key12',
          labelName: '工时费：',
          codeField: 'wiAmount',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key13',
          labelName: '备件费：',
          codeField: 'partAmount',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key14',
          labelName: '其他费用：',
          codeField: 'otherAmount',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key15',
          labelName: '总金额：',
          codeField: 'sumAmount',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key16',
          labelName: '同意单号：',
          codeField: 'agreeNo',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          // disabled: true
        }
      ],
      tableComponents2: [
        {
          compKey: 'key0',
          labelName: '派工单号：',
          codeField: 'repairOrderCode',
          isMul: false,
          component: () => import('@/components/se/sparePartNameCode'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key1',
          labelName: '车牌号：',
          codeField: 'carLicense',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key2',
          labelName: '车型：',
          codeField: 'carConfigCN',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key3',
          labelName: '进厂时间：',
          codeField: 'repairDate',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key4',
          labelName: '保修开始日期：',
          codeField: 'invoiceDate',
          isMul: false,
          component: () => import('@/components/org/datePicker/datePicker.vue'),
          type: 'datePicker',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key5',
          labelName: '行驶里程：',
          codeField: 'mileage',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key6',
          labelName: '购件里程：',
          codeField: 'payMileage',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true
        },
        {
          compKey: 'key7',
          labelName: '购件日期：',
          codeField: 'payDate',
          isMul: false,
          component: () => import('@/components/org/datePicker/datePicker.vue'),
          type: 'datePicker',
          isMust: true
        },
        {
          compKey: 'key8',
          labelName: '保修申请单号：',
          codeField: 'preAuthorCode',
          clickEvent: () => this.goClaimApplication(),
          component: () => import('@/components/org/commonInput/indexLink.vue'),
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key9',
          labelName: 'VIN码：',
          codeField: 'VIN',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key11',
          labelName: '车辆用途：',
          codeField: 'buyCaruseCodeName',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key12',
          labelName: '生产日期：',
          codeField: 'produceDate',
          isMul: false,
          component: () => import('@/components/org/datePicker/datePicker.vue'),
          type: 'datePicker',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key13',
          labelName: '前电机号：',
          codeField: 'engineCode',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key14',
          labelName: '后电机号：',
          codeField: 'engineCode2',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key15',
          labelName: '底盘号：',
          codeField: 'underpanNO',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key16',
          labelName: '变速箱号：',
          codeField: 'ectCode',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        }
      ],
      tableComponents3: [
        {
          compKey: 'key0',
          labelName: '车主姓名：',
          codeField: 'custName',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key1',
          labelName: '性别：',
          codeField: 'gender',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key2',
          labelName: '车主手机：',
          codeField: 'phone',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key3',
          labelName: '省份：',
          codeField: 'addrPrivince',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key4',
          labelName: '城市：',
          codeField: 'addrCity',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key5',
          labelName: '区县：',
          codeField: 'addrCounty',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key6',
          labelName: '街道地址：',
          codeField: 'addrStreet',
          // span: 12,
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key7',
          labelName: '送修人：',
          codeField: 'linkMan',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key8',
          labelName: '送修人电话：',
          codeField: 'linkManTels',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        }
      ],
      tableComponents4: [
        {
          compKey: 'key0',
          labelName: '故障类型',
          codeField: 'custType',
          textField: 'custTypeName',
          customObj: {
            api: api.findCustType,
            selectType: '1',
            defOptionFields: ['custType', 'custTypeName']
          },
          component: () => import('@/components/org/commonSelect'),
          type: 'dropdownList',
          isMust: true,
          isRequire: true
        },
        {
          compKey: 'key2',
          labelName: '主故障件名称：',
          codeField: 'partName',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key1',
          labelName: '主故障件编码：',
          codeField: 'partNo',
          component: () => import('@/components/org/commonSelect'),
          type: 'inputText',
          isMust: true,
          isMul: false
        },
        {
          compKey: 'key3',
          labelName: '故障日期：',
          codeField: 'faultDate',
          isMul: false,
          component: () => import('@/components/org/datePicker/datePicker.vue'),
          type: 'datePicker',
          isMust: true,
          // disabled: true,
          isRequire: true
        },
        {
          compKey: 'key4',
          labelName: '故障现象码：',
          codeField: 'csCode',
          customObj: {
            api: api.findFaultPhenomenon,
            defOptionFields: ['csCtCode', 'csCtName']
          },
          component: () => import('@/components/org/commonSelect'),
          type: 'dropdownList',
          isMust: true
        },
        // {
        //   compKey: "key5",
        //   labelName: "故障原因码：",
        //   codeField: "saleOrderCode",
        //   isMul: false,
        //   component: () => import('@/components/org/commonInput/searchInput'),
        //   type: "inputText",
        //   isMust: true,
        // },
        {
          compKey: 'key6',
          labelName: '故障部位：',
          codeField: 'faultPartCode',
          textField: 'faultPartName',
          customObj: {
            api: api.findFaultPartName,
            defOptionFields: ['faultPartCode', 'faultPartName']
          },
          component: () => import('@/components/org/commonSelect'),
          type: 'dropdownList',
          isMust: true
        },
        // {
        //   compKey: 'key7',
        //   labelName: '故障数据：',
        //   codeField: 'faultDTC',
        //   isMul: false,
        //   component: () => import('@/components/org/commonInput'),
        //   type: 'inputText',
        //   isMust: true
        // },
        // {
        //   compKey: 'key8',
        //   labelName: '备注：',
        //   codeField: 'remark',
        //   isMul: false,
        //   span: 16,
        //   component: () => import('@/components/org/commonInput'),
        //   type: 'inputText',
        //   isMust: true
        // },
        {
          compKey: 'key9',
          labelName: '故障描述：',
          codeField: 'custComplainCS',
          component: () => import('@/components/org/commonInput/textareaInput'),
          type: 'dropdownList',
          isRequire: true,
          isMust: true,
          span: 24
        },
        {
          compKey: 'key10',
          labelName: '诊断过程：',
          codeField: 'detailCheckSynopsis',
          component: () => import('@/components/org/commonInput/textareaInput'),
          type: 'dropdownList',
          isMust: true,
          isRequire: true,
          span: 24
        },
        {
          compKey: 'key11',
          labelName: '故障处理：',
          codeField: 'repairWay',
          component: () => import('@/components/org/commonInput/textareaInput'),
          type: 'dropdownList',
          isRequire: true,
          isMust: true,
          span: 24
        }
      ],

      tableHeader_4_2: [
        {
          prop: "controlBtn",
          label: "操作",
          codeField: "controlBtn",
          width: 100,
          align: "center",
          fixed: true,
          isComponent: true,
          comps: [
            {
              compKey: "propKey1",
              align: "center",
              labelName: "下载",
              component: () => import("@/components/org/linkButton"),
              clickEvent: (index) => this.fileDownload(index),
            },
          ],
        },
        {
          label: '附件名称',
          prop: 'fileName'
        },
        {
          label: '附件路径',
          prop: 'attachmentFilePath',
          hidden: true,
          alwaysHidden: true
        },
        {
          label: '备注',
          prop: 'fileRemark'
        }
      ],
      tableHeader_4_3: [
        {
          label: '工时编码',
          prop: 'wiCode'
        },
        {
          label: '维修内容',
          prop: 'wiName'
        },
        {
          label: '工时数',
          prop: 'wiQty'
        },
        {
          label: '工时单价',
          prop: 'wiPrice'
        },
        {
          label: '索赔系数',
          prop: 'claimWiCoef'
        },
        {
          label: '费用合计',
          prop: 'wiTotal'
        }
      ],
      tableHeader_4_4: [
        {
          label: '备件编码',
          prop: 'partNo'
        },
        {
          label: '备件名称',
          prop: 'partName'
        },
        {
          label: '数量',
          prop: 'partQty'
        },
        {
          label: '单价',
          prop: 'partPrice'
        },
        {
          label: '索赔系数',
          prop: 'claimPartCoef'
        },
        {
          label: '费用合计',
          prop: 'partTotal'
        }
      ],
      tableHeader_4_5: [
        {
          label: '其他项目No',
          prop: 'otherFeeId',
          hidden: true,
          alwaysHidden: true
        },
        {
          label: '其他项目',
          prop: 'otherFeeName'
        },
        {
          label: '费用',
          prop: 'otherFee'
        },
        {
          label: '备注',
          prop: 'otherRemark'
        }
      ],
      tableHeader_4_6: [
        {
          label: '保修鉴定申诉ID',
          prop: 'appealID',
          hidden: true,
          alwaysHidden: true
        },
        {
          label: '审核状态',
          prop: 'claimStatus'
        },
        {
          label: '审核意见',
          prop: 'checkInfo'
        },
        {
          label: '审核人',
          prop: 'checkMan'
        },
        {
          label: '审核时间',
          prop: 'checkTime'
        },
        {
          label: '备注',
          prop: 'auditRemark'
        }
      ],
      tableHeader_4_7: [
        {
          compKey: 'key0',
          labelName: '倒扣单号：',
          codeField: 'reverseCode',
          component: () => import('@/components/org/LookupValue'),
          oFields: 'statusId,statusText',
          options: [
            { statusId: '1', statusText: '文章/文章' },
            { statusId: '0', statusText: '文章' }
          ],
          type: 'dropdownList',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key1',
          labelName: '倒扣状态：',
          codeField: 'reverseStatus',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key2',
          labelName: '已扣金额：',
          codeField: 'buckledAmount',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key3',
          labelName: '待扣金额：',
          codeField: 'yetAmount',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        {
          compKey: 'key4',
          labelName: '倒扣金额：',
          codeField: 'reverseAmount',
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        },
        // claimId  保修鉴定单ID
        {
          compKey: 'key5',
          labelName: '倒扣原因：',
          codeField: 'reason',
          span: 18,
          isMul: false,
          component: () => import('@/components/org/commonInput'),
          type: 'inputText',
          isMust: true,
          disabled: true
        }
      ],
      formField: {
        dlrCode: '',
        dlrFullName: '',
        claimStatus: '',
        claimEmpNO: '',
        linkManTel: '',
        claimType: '',
        actionCode: '',
        claimMonth: '',
        submitDate: '',
        shipAmount: '',
        compAmount: '',
        wiAmount: '',
        partAmount: '',
        otherAmount: '0',
        sumAmount: '0',
        repairOrderCode: '',
        carLicense: '',
        carConfigCN: '',
        repairDate: '',
        invoiceDate: '',
        mileage: '',
        payMileage: '',
        payDate: '',
        preAuthorCode: '',
        VIN: '',
        buyCaruseCodeName: '',
        produceDate: '',
        engineCode: '',
        engineCode2: '',
        underpanNO: '',
        ectCode: '',
        gender: '',
        phone: '',
        addrPrivince: '',
        addrCity: '',
        addrCounty: '',
        addrStreet: '',
        linkMan: '',
        linkManTels: '',
        custType: '',
        partNo: '',
        partName: '',
        faultDate: '',
        csCode: '',
        faultDTC: '',
        remark: '',
        custComplainCS: '',
        detailCheckSynopsis: '',
        repairWay: '',
        faultPartCode: '',
        fujianInfo: [],
        claimProject: [],
        claimPart: [],
        claimOtherPart: [],
        claimInfo: [],
        auditInfo: []
      }
    }
  },

  methods: {
    // 下载附件
    fileDownload(index) {
      // console.log("1111111111111", index);
       if(this.$refs["table_3_1"].list [index].attachmentFilePath){
        this.$utils.FileDownload([this.$refs["table_3_1"].list [index].attachmentFilePath])
      }
    },
    openDialog() {
      this.findClaimDetail()
    },

    findClaimDetail() {
      const queryObj = {
        // 保存mutation
        type: 'query',
        // api配置
        apiConfig: api.findClaimDetail,
        // 条件/实体参数（变量），根据typeParam中的定义配置
        variables: {
          claimCode: this.dynamicEditRowData.claimCode
        }
      }
      // 转换了中台请求格式数据
      var paramD = this.$getParams(queryObj)
      // 调用中台API方法（可复用）
      this.$requestAPI(paramD).then(res => {
        if (res.result === '1') {
          this.formField = res.rows[0]
          this.formField.fujianInfo = res.rows[0].fujianInfo
          this.formField.fujianInfo = res.rows[0].fujianInfo
          this.$refs['table_3_1'].list = this.formField.fujianInfo
          this.$refs['table_3_2'].list = this.formField.workingHoursInfo
          this.$refs['table_3_3'].list = this.formField.sparePartInfo
          this.$refs['table_3_4'].list = this.formField.otherInfo
          this.$refs['table_3_5'].list = this.formField.claimInfo
          this.$refs['table_3_7'].list = this.formField.auditInfo
        }
      })
    },
    // 关闭弹窗
    closeEdit() {
      this.$emit('update:popupsVisible', false)
      this.oneTableKey = this.$utils.generateId()
    }
  }
}
</script>

<style lang='scss' scoped>
  .promptSpan{
  position: absolute;
  bottom: 26px;
  right: 335px;
  color: #e70020;
}
</style>

